package com.dd.common.dto.system.notice;

import com.dd.common.validator.annotation.ValidTimeRange;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import java.time.LocalDateTime;

/**
 * @author cheng
 */
@ValidTimeRange(
        start = "publishTimeStart",
        end = "publishTimeEnd",
        message = "发布时间段：开始时间不能晚于结束时间"
)
@ValidTimeRange(
        start = "expireTimeStart",
        end = "expireTimeEnd",
        message = "过期时间段：开始时间不能晚于结束时间"
)
@Schema(description = "系统公告查询DTO")
@Data
public class SysNoticeQueryDTO implements java.io.Serializable {
    @Schema(description = "标题", example = "系统公告")
    private String noticeTitle;

    @Schema(description = "富文本内容", example = "<p>本周六（8月10日）凌晨 02:00 - 06:00 进行系统升级维护，请提前保存数据。")
    private String noticeContent;

    @Range(min = 1, max = 3, message = "类型值只能是1、2、3")
    @Schema(description = "类型：1-通知，2-公告，3-警告", example = "1")
    private Integer noticeType;

    @Schema(description = "发布人署名，注意不是发布者ID对应的名称", example = "运营团队")
    private String publisherName;

    @Schema(description = "发布时间起始", example = "2021-01-01 00:00:00")
    private LocalDateTime publishTimeStart;
    @Schema(description = "发布时间结束", example = "2021-12-31 23:59:59")
    private LocalDateTime publishTimeEnd;

    @Schema(description = "过期时间起始", example = "2021-01-01 00:00:00")
    private LocalDateTime expireTimeStart;
    @Schema(description = "过期时间结束", example = "2021-12-31 23:59:59")
    private LocalDateTime expireTimeEnd;

    @Schema(description = "状态：1-正常，0-禁用", example = "1")
    @Range(min = 0, max = 1, message = "状态值只能是0或1")
    private Integer status;
}
